package com.example.day09.ex01;

import com.example.day07.ex04.Student;

import java.util.ArrayList;

public class ArrayListTest02 {
    public static void main(String[] args) {
        ArrayList<Student> array=new ArrayList<Student>();
        Student s1=new Student("张三",20);
        Student s2=new Student("李四",21);
        Student s3=new Student("王五",22);
        array.add(s1);
        array.add(s2);
        array.add(s3);
        for(int i=0;i<array.size();i++){
            Student s=array.get(i);
            System.out.println(s.getName()+","+s.getAge());
        }
    }
}
